<%@page contentType="text/html; charset=utf-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%@taglib uri="/WEB-INF/debug-tags.tld" prefix="d"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>邮件列表</title>
<script type="text/javascript" src="<s:url value="/js/select.js"/>"></script>
<link href="<s:url value="/css/admin.css"/>" rel="stylesheet" type="text/css">
</head>
<body>
<s:form action="email" name="frm" method="get">
    <br><table width="78%"  border="1" align="center" cellpadding="0" cellspacing="0" style="border-collapse:collapse " frame="hsides">
  <tr>
    <td width="19%" align="right">标题:</td>
    <td width="31%"><s:textfield name="title"/> </td>
    <td width="18%" align="right">接收地址:</td>
    <td width="32%"><s:textfield  name="toAddress"/> </td>
  </tr>
  <tr>
    <td align="right">内容:</td>
    <td><s:textfield  name="content"/> </td>
    <td align="right">状态:</td>
    <td><s:select list="%{getStatusMap()}" name="status" headerKey="-1" headerValue="全部"/> </td>
  </tr>
  <tr>
    <td align="right">&nbsp;</td>
    <td>&nbsp;</td>
    <td align="right">显示记录数:</td>
    <td><s:textfield name="pageSize" size="10"/> </td>
  </tr>
</table>
    <br>
<center><input type="button" value=" 查 询 " onclick="frm.submit();"/> <br><br>
</center>
<table width="98%"  border="1" align="center" cellpadding="0" cellspacing="0" style="border-collapse:collapse ">
      <tr align="center">
        <td width="5%" height="25"><strong>序号</strong></td>
        <td width="49%"><strong>标题</strong></td>
        <td width="12%"><strong>接收地址</strong></td>
        <td width="10%"><strong>状态</strong></td>
        <td width="15%"><strong>发送时间</strong></td>
        <td width="9%"><strong>操作</strong></td>
      </tr>
      <s:iterator value="list" status="i">
      <tr align="center">
        <td height="25"><s:property value="%{#i.index+1}"/> </td>
        <td align="left"><a href="<s:url action="viewemail" includeParams="none"><s:param name="id" value="id"/></s:url>" target="blank"><s:property value="title"/></a></td>
        <td align="center"><s:property value="toAddress"/> </td>
        <td align="center"><s:property value="%{getStatusName(status)}"/> </td>
        <td align="center"><s:date name="sendDate" format="yyyy-MM-dd hh:mm:ss"/> </td>
        <td>
        <s:url action="deleteemail" id="deleteurl" includeParams="none">
        	<s:param name="id" value="id"/>
        </s:url>
        <a href="${deleteurl}" onclick="return confirm('确定要删除吗?');">删除</a>
        </td>
      </tr>
      </s:iterator>
      <s:if test="%{list.size()<10}">
      <s:generator separator="" val="#{''}" count="%{10-list.size()}">
      <s:iterator>
      <tr align="center">
        <td height="25">&nbsp;</td>
        <td>&nbsp;</td>
        <td align="left">&nbsp;</td>
        <td align="left">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      </s:iterator>
      </s:generator>
      </s:if>
      <tr align="center">
        <td height="25" colspan="6" align="right"><d:page list="list"/> </td>
      </tr>
  </table>
</s:form>
</body>
</html>
